<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"  isELIgnored="false"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ page import="java.util.*,com.hengpeng.itfinbase.persist.AppGroup"%>
<%@ taglib prefix="chtml" uri="http://www.szhelper.com/jsp/html"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>修改分组</title>
<script type="text/javascript">
function onsubmits() {
	var sels = document
			.getElementById("appgroup_store_self");

	for ( var i = 0; i < sels.length; i++) {
		sels.options[i].selected = true;
	}
	return true;
}
</script>
</head>
<body>
<div class="youarehere">权限管理 &gt; <span>管理系统组</span> &gt; <span>修改分组</span></div>
<chtml:command command="group" onSubmit="onsubmits()" exclude="parent"
	title="修改组" action="/acm/appgroup/modify">
	<chtml:property index="-1" label="所属分组">
		<select name="parent">
			<%
				AppGroup g = (AppGroup) request.getAttribute("group");
					if (g.getParent() == null)
					{
						out.println("<option value='0' selected='selected'>--无--</option>");
					}
					else
					{
						out.println("<option value='0'>--无--</option>");
					}
					Set<AppGroup> set = (Set<AppGroup>) request.getAttribute("sortlist");
					for (AppGroup group : set)
					{
						String text = "&nbsp;";
						if (group.getParent() == null)
						{
							text = "&nbsp;";
						}
						else
						{
							AppGroup parent = group.getParent();
							while (parent != null)
							{
								text = text + "&nbsp;&nbsp;";
								parent = parent.getParent();
							}
							text += "┕";
						}
						text = text + group.getName();
						if (g.getParent() != null && group.getId().equals(g.getParent().getId()))
						{
							out.println("<option value='" + group.getId() + "' selected='selected'>" + text + "</option>");
						}
						else
						{
							out.println("<option value='" + group.getId() + "'>" + text + "</option>");
						}
					}
			%>
		</select>
	</chtml:property>

		<chtml:property index="-1" label="代理商">
			<table border="0">
				<tr>
					<td><SELECT tabindex="1" id="appgroup_store_all"
						NAME="appgroup_store_all" multiple="multiple"
						style="width: 140px; height: 230px;">
							<c:forEach items="${requestScope.diff}" var="store">
								<option value="${store.id }">${store.name }</option>
							</c:forEach>
					</SELECT>
					</td>
					<td style="width: 65px; text-align: center;"><a href="#"
						onclick="javascript:helper.fun.moveSelectItem('appgroup_store_all','appgroup_store_self');">添加</a><br>
						<br> <a href="#"
						onclick="javascript:helper.fun.moveSelectItem('appgroup_store_self','appgroup_store_all');">移除</a>
					</td>
					<td><SELECT tabindex="1" id="appgroup_store_self"
						NAME="storeIds" multiple="multiple"
						style="width: 140px; height: 230px;">
							<c:forEach items="${requestScope.stores}" var="store">
								<option value="${store.id }">${store.name }</option>
							</c:forEach>
					</SELECT>
					</td>
				</tr>
			</table>
		</chtml:property>

		<chtml:button destination="/acm/appgroup/modify" showText="修改"></chtml:button>
	
	</chtml:command>
		<!--说明   -->	
<div class="sm_info">
	<p class="row_one">说明：</p>
	<p class="other"></p>
	<p class="other"></p>
</div>
</body>
</html>